package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
class Arr<E extends Comparable<E>>{
    public E findMax(E[] array){
        E max = array[0];
        for (int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i])<0){
                max = array[i];
            }
        }
        return max;
    }
}
/*class Student implements Comparable<Student>{

    @Override
    public int compareTo(Student o) {
        return 0;
    }
}*/
public class Test {
    public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5,6};
        Arr<Integer> arr = new Arr<>();
        System.out.println(arr.findMax(array));
       /* Arr<Student> arr1 = new Arr<>();*/

    }
}
